Discovering high-level language data structures from assembler code

ABSTRACT

A computer-implemented method for transforming implicit data structures expressed by assembler code into high-level language structures includes analyzing a section of assembler code to identify a plurality of data items. The computer-implemented method further includes storing the plurality of data items in a plurality of groups. The computer-implemented method further includes modifying one or more groups in the plurality of groups based, at least in part, on a pair of adjacent groups having a non-identical overlap. The computer-implemented method further includes creating an overlap list for each group. The computer-implemented method further includes generating data modeling language for the section based, at least in part, on each overlap list. A corresponding computer system and computer program product are also disclosed.

STATEMENT ON PRIOR DISCLOSURES BY AN INVENTOR

The following disclosure(s) are submitted under 35 U.S.C. 102 (b)(1)(A)as prior disclosures by, or on behalf of, a sole inventor of the presentapplication or a joint inventor of the present application:

IBM High Level Assembler (HLASM) fix made publicly available on May 3,2016; a description of the fix and the release date for the fix (“ClosedDate”) can be found at:http://www-01.ibm.com/support/docview.wss?uid=isg1PI54476.

BACKGROUND OF THE INVENTION

The present invention relates to processing assembler code, and morespecifically to discovering high-level language data structures bygenerating data model language from assembler code.

Multiple programming languages are often used together within softwareprograms. Accordingly, it is important that data can be shared betweenmultiple programming languages in order for different programs andlanguages to effectively work together. Most high-level programminglanguages have highly structured data which can be transformed from onestructure into another through a broker program. Assembler languagesoffer a rich way of defining individual data items. However, these dataitems are highly unstructured, as they can be placed anywhere within aprogram and can exist in any form.

SUMMARY

A computer-implemented method for transforming implicit data structuresexpressed by assembler code into high-level language structures includesanalyzing a section of assembler code to identify a plurality of dataitems, wherein the section of assembler code has a beginning and an end.The computer-implemented method further includes storing the pluralityof data items in a plurality of groups. The plurality of groupscorresponds to the section of assembler code. The plurality of dataitems is stored based, at least in part, on: their offset from a startof a group in the section, and an order in which the data items areadded to the section. The computer-implemented method further includesmodifying one or more groups in the plurality of groups based, at leastin part, on a pair of adjacent groups having a non-identical overlap.The computer-implemented method further includes creating an overlaplist for each group, wherein the overlap list identifies those othergroups in the plurality of groups that overlap with the group. Thecomputer-implemented method further includes generating data modelinglanguage for the section based, at least in part, on each overlap list.A corresponding computer system and computer program product are alsodisclosed.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a functional block diagram of a computing environment inaccordance with at least one embodiment of the invention.

FIG. 2 is a schematic diagram illustrating additional data structuresgenerated by an assembler sub-system in accordance with at least oneembodiment of the invention.

FIG. 3 is a flowchart diagram depicting operational steps for anassembler sub-system in accordance with at least one embodiment of theinvention.

FIG. 4 is a flowchart diagram depicting operational steps for a datamodel generator sub-system in accordance with at least one embodiment ofthe invention.

FIG. 5 is a flowchart diagram depicting operational steps for a datamodel generator sub-system in accordance with at least one embodiment ofthe invention.

FIGS. 6A-6D are schematic diagrams illustrating a worked example inaccordance with at least one embodiment of the invention.

DETAILED DESCRIPTION

Embodiments of the present invention recognize that due to theunstructured nature of assembler languages, pieces of data and parts ofa program can be overwritten. Embodiments of the present inventionrecognize that due to the unstructured format of data items written inan assembler language, it becomes difficult for a broker program tocohesively identify the structure of an assembler program's data inorder to transform the data.

Embodiments of the present invention discover implicit data structuresas expressed by assembler code and transform the free-form assemblerdata into highly structured high-level language structures. Embodimentsof the present invention generate data modeling language statements andconstructs from assembler language while preserving implicit datastructures that exist in assembler code.

Embodiments of the present invention map implicit data structures, foundby analyzing assembler code, into a highly-structured form as expressedby a high-level language, such as data format description language(“DFDL”). DFDL is a modeling language for describing general text andbinary data in a standard way. A DFDL model or schema allows any text orbinary data to be read (or “parsed”) from its native format and to bepresented as an instance of an information set. An information set is alogical representation of the data contents, independent of the physicalformat. For example, two records can be represented by different formats(e.g., one record has fixed-length fields, while a second record usesdelimiters), but can contain the same data and can be represented by thesame information set. The DFDL schema also allows data to be taken froman instance of an information set and written out (or “serialized”) intoits native format.

It should generally be understood that DFDL is not a data format, nordoes it impose the use of any particular data format. Instead itprovides a standard way of describing many different kinds of dataformats. DFDL achieves this by building upon the facilities of W3C XMLSchema 1.0. In embodiments of the invention, a subset of XML Schema isused in order to enable the modeling of non-XML data. The motivationsfor this approach are to avoid inventing a completely new schemalanguage, and to easily convert general text and binary data, via a DFDLinformation set, into a corresponding XML document.

Embodiments of the present invention provide for the use of a data modelgenerator sub-system to create data modeling language statementsrepresenting the data items in each section of a program. Embodiments ofthe present invention provide for the use of a data model generatorsub-system to discover the structure of assembler language data itemsbased on the offsets of each data item within a program section. Eachassembler language includes a number of sections and each sectionincludes a number of data items and/or machine instructions. Forexample, IBM® High Level Assembler (HLASM) language provides twoassembler directives (Define Constant (DC) and Define Storage (DS))which an assembler application programmer uses to define storage areasthat are referenced during program execution.

The present invention may be a method, computer program product, and/ora computer system for discovering the structure of data in an assemblerlanguage program and transforming it into a common data modelinglanguage (such as DFDL or Extensible Markup Language (XML)). Thecomputer program product may include a computer readable storage medium(or media) having computer readable program instructions thereon forcausing a processor to carry out aspects of the present invention.

The computer readable storage medium can be a tangible device that canretain and store instructions for use by an instruction executiondevice. The computer readable storage medium may be, for example, but isnot limited to, an electronic storage device, a magnetic storage device,an optical storage device, an electromagnetic storage device, asemiconductor storage device, or any suitable combination of theforegoing. A non-exhaustive list of more specific examples of thecomputer readable storage medium includes the following: a portablecomputer diskette, a hard disk, a random access memory (RAM), aread-only memory (ROM), an erasable programmable read-only memory (EPROMor Flash memory), a static random access memory (SRAM), a portablecompact disc read-only memory (CD-ROM), a digital versatile disk (DVD),a memory stick, a floppy disk, a mechanically encoded device such aspunch-cards or raised structures in a groove having instructionsrecorded thereon, and any suitable combination of the foregoing. Acomputer readable storage medium, as used herein, is not to be construedas being transitory signals per se, such as radio waves or other freelypropagating electromagnetic waves, electromagnetic waves propagatingthrough a waveguide or other transmission media (e.g., light pulsespassing through a fiber-optic cable), or electrical signals transmittedthrough a wire.

Computer readable program instructions described herein can bedownloaded to respective computing/processing devices from a computerreadable storage medium or to an external computer or external storagedevice via a network, for example, the Internet, a local area network, awide area network and/or a wireless network. The network may comprisecopper transmission cables, optical transmission fibers, wirelesstransmission, routers, firewalls, switches, gateway computers and/oredge servers. A network adapter card or network interface in eachcomputing/processing device receives computer readable programinstructions from the network and forwards the computer readable programinstructions for storage in a computer readable storage medium withinthe respective computing/processing device.

Computer readable program instructions for carrying out operations ofthe present invention may be assembler instructions,instruction-set-architecture (ISA) instructions, machine instructions,machine dependent instructions, microcode, firmware instructions,state-setting data, configuration data for integrated circuitry, oreither source code or object code written in any combination of one ormore programming languages, including an object oriented programminglanguage such as Smalltalk, C++, or the like, and procedural programminglanguages, such as the “C” programming language or similar programminglanguages. The computer readable program instructions may executeentirely on the user's computer, partly on the user's computer, as astand-alone software package, partly on the user's computer and partlyon a remote computer or entirely on the remote computer or server. Inthe latter scenario, the remote computer may be connected to the user'scomputer through any type of network, including a local area network(LAN) or a wide area network (WAN), or the connection may be made to anexternal computer (for example, through the Internet using an InternetService Provider). In some embodiments, electronic circuitry including,for example, programmable logic circuitry, field-programmable gatearrays (FPGA), or programmable logic arrays (PLA) may execute thecomputer readable program instructions by utilizing state information ofthe computer readable program instructions to personalize the electroniccircuitry, in order to perform aspects of the present invention.

Aspects of the present invention are described herein with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems), and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer readable program instructions.

These computer readable program instructions may be provided to aprocessor of a general purpose computer, special purpose computer, orother programmable data processing apparatus to produce a machine, suchthat the instructions, which execute via the processor of the computeror other programmable data processing apparatus, create means forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks. These computer readable program instructionsmay also be stored in a computer readable storage medium that can directa computer, a programmable data processing apparatus, and/or otherdevices to function in a particular manner, such that the computerreadable storage medium having instructions stored therein comprises anarticle of manufacture including instructions which implement aspects ofthe function/act specified in the flowchart and/or block diagram blockor blocks.

The computer readable program instructions may also be loaded onto acomputer, other programmable data processing apparatus, or other deviceto cause a series of operational steps to be performed on the computer,other programmable apparatus or other device to produce a computerimplemented process, such that the instructions which execute on thecomputer, other programmable apparatus, or other device implement thefunctions/acts specified in the flowchart and/or block diagram block orblocks.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods, and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof instructions, which comprises one or more executable instructions forimplementing the specified logical function(s). In some alternativeimplementations, the functions noted in the blocks may occur out of theorder noted in the Figures. For example, two blocks shown in successionmay, in fact, be executed substantially concurrently, or the blocks maysometimes be executed in the reverse order, depending upon thefunctionality involved. It will also be noted that each block of theblock diagrams and/or flowchart illustration, and combinations of blocksin the block diagrams and/or flowchart illustration, can be implementedby special purpose hardware-based systems that perform the specifiedfunctions or acts or carry out combinations of special purpose hardwareand computer instructions.

An embodiment of a possible hardware and software environment forsoftware and/or methods according to the present invention will now bedescribed with reference to the Figures. FIG. 1 is a functional blockdiagram illustrating various portions of a computing environment,generally designated 100, suitable for operation of computer 200. FIG. 1provides only an illustration of one implementation and does not implyany limitations with regard to the environments in which differentembodiments may be implemented. Many modifications to the depictedenvironment may be made by those skilled in the art without departingfrom the scope of the invention as recited by the claims.

FIG. 1 includes: assembler sub-system 102; data model generator (“DMG”)sub-system 104; communication network 106; computer 200; display device212; and external devices 214. Computer 200 includes: communication unit202; processor set 204; input/output (I/O) interface set 206; memorydevice 208; and persistent storage device 210. Memory device 208contains: random access memory (RAM) devices 216; and cache memorydevice 218. Persistent storage device 210 includes program instructionsfor assembler sub-system 102 and DMG sub-system 104.

Assembler sub-system 102 is, in many respects, representative of thevarious computer sub-systems in the present invention. Accordingly,several portions of assembler sub-system 102 will now be discussed inthe following paragraphs.

Assembler sub-system 102 may be a laptop computer, a tablet computer, anetbook computer, a personal computer (PC), a desktop computer, apersonal digital assistant (PDA), a smart phone, or any programmableelectronic device capable of communicating with client sub-systems viacommunication network 106.

Assembler sub-system 102 is capable of communicating with other computersubsystems via communication network 106. Communication network 106 canbe, for example, a local area network (LAN), a wide area network (WAN)such as the Internet, or a combination of the two, and can includewired, wireless, or fiber optic connections. In general, communicationnetwork 106 can be any combination of connections and protocols thatwill support communications between assembler sub-system 102 and DMGsub-system 104.

Assembler sub-system 102 is shown as a block diagram with many doublearrows. These double arrows (no separate reference numerals) represent acommunications fabric, which provides communications between variouscomponents of assembler sub-system 102. This communications fabric canbe implemented with any architecture designed for passing data and/orcontrol information between processors (such as microprocessors,communications processors, and/or network processors, etc.), systemmemory, peripheral devices, and any other hardware components within asystem. For example, the communications fabric can be implemented, atleast in part, with one or more buses.

Memory device 208 and persistent storage device 210 are computerreadable storage media. In general, memory device 208 can include anysuitable volatile or non-volatile computer readable storage media. It isfurther noted that, now and/or in the near future: (i) external devices214 may be able to supply some, or all, memory for assembler sub-system102; and/or (ii) devices external to assembler sub-system 102 may beable to provide memory for assembler sub-system 102.

Program instructions for assembler sub-system 102 may be stored inpersistent storage device 210, or more generally, any computer readablestorage media, for access and/or execution by one or more processors ofprocessor set 204, usually through memory device 208. Persistent storagedevice 210: (i) is at least more persistent than a signal in transit;(ii) stores the program (including its soft logic and/or data) on atangible medium (such as magnetic or optical domains); and (iii) issubstantially less persistent than permanent storage. Alternatively,data storage may be more persistent and/or permanent than the type ofstorage provided by persistent storage device 210.

Persistent storage device 210 may be a magnetic hard disk drive, a solidstate disk drive, a semiconductor storage device, read-only memory(ROM), electronically erasable programmable read-only memory (EEPROM),flash memory, or any other computer readable storage media that iscapable of storing program instructions or digital information.

The media used by persistent storage device 210 may also be removable.For example, a removable hard drive may be used for persistent storagedevice 210. Other examples include optical and magnetic disks, thumbdrives, and smart cards that are inserted into a drive for transfer ontoanother computer readable storage medium that is also part of persistentstorage device 210.

Communication unit 202, in these examples, provides for communicationswith other data processing systems or devices external to assemblersub-system 102. In these examples, communication unit 202 includes oneor more network interface cards. Communication unit 202 may providecommunications through the use of either or both physical and wirelesscommunications links. Any software modules discussed herein may bedownloaded to a persistent storage device (such as persistent storagedevice 210) through a communications unit (such as communication unit202).

I/O interface set 206 allows for input and output of data with otherdevices that may be connected locally in data communication withcomputer 200. For example, I/O interface set 206 provides a connectionto external devices 214. External devices 214 will typically includedevices, such as a keyboard, a keypad, a touch screen, and/or some othersuitable input device. External devices 214 can also include portablecomputer readable storage media, such as, for example, thumb drives,portable optical or magnetic disks, and memory cards. Software and dataused to practice embodiments of the present invention can be stored onsuch portable computer readable storage media. In these embodiments, therelevant software may (or may not) be loaded, in whole or in part, ontopersistent storage device 210 via I/O interface set 206. I/O interfaceset 206 also connects in data communication with display device 212.

Display device 212 provides a mechanism to display data to a user andmay be, for example, a computer monitor or a smart phone display screen.

The programs described herein are identified based upon the applicationfor which they are implemented in a specific embodiment of theinvention. However, it should be appreciated that any particular programnomenclature herein is used merely for convenience, and thus, theinvention should not be limited to use solely in any specificapplication identified and/or implied by such nomenclature.

The descriptions of the various embodiments of the present inventionhave been presented for purposes of illustration, but are not intendedto be exhaustive or limited to the embodiments disclosed. Manymodifications and variations will be apparent to those of ordinary skillin the art without departing from the scope and spirit of the describedembodiments. The terminology used herein was chosen to best explain theprinciples of the embodiments, the practical application or technicalimprovement over technologies found in the marketplace, or to enableothers of ordinary skill in the art to understand the embodimentsdisclosed herein.

FIG. 2 is a schematic diagram, generally designated 200, illustratingadditional data structures generated by assembler sub-system 102 inaccordance with at least one embodiment of the invention. In embodimentsof the invention, in addition to its normal processing, assemblersub-system 102 creates three additional types of data structures fordata model processing. The three additional types of data structuresinclude section blocks, group blocks, and data item blocks. It should beappreciated that these additional data structures may be linked togetherso that a section block possesses a number of group blocks and eachgroup block possesses a number of data item blocks.

For simplicity purposes, FIG. 2 depicts the following additional datastructures: section block 261, group blocks 266 and 267, and data itemblocks 271, 272, and 273. In the depicted embodiment, section block 261includes group blocks 266 and 267. Group block 266 includes data itemblocks 271 and 272. Group block 267 includes data item block 273. Asfurther depicted in FIG. 2, section list 260, group list 265, and dataitem list 270 have been created. However, in embodiments of theinvention, assembler sub-system 102 generates a plurality of sectionblocks. Accordingly, each section block can include multiple groupblocks and each group block can include multiple data item blocks.Similarly, in embodiments of the invention, DMG sub-system 104 generatesa plurality of group lists and data item lists, such that each grouplist includes multiple group blocks corresponding to a section block andeach data item list includes multiple data items corresponding tomultiple group blocks of a section block. It should be noted thatthroughout the specification, the terms section block, group block, anddata item block may be used interchangeably with the terms section,group, and data item, respectively.

FIG. 2 further depicts assembler anchor block 255, which points to thestart of section list 260, as well as the current section to which datais being added. The section block for the current section beingprocessed is pointed to by part of assembler sub-system 102 so that assections are paused and resumed, the correct section block representinga section of the assembler program that is currently being processed canbe referenced. For example, in the depicted embodiment, assemblersub-system 102 has generated assembler anchor block 255 with a pointerinitially directed to the start of the first section block (sectionblock 261) in section list 260. Section list 260 points to correspondinggroup list 265, which includes group block 266 and group block 267.Group list 265 points to corresponding data item list 270, whichincludes data item block 271, data item block 272, and data item block273. Additionally, group list 265 may point to a corresponding overlaplist, such as overlap list 275. When outputting data item blockscorresponding to a group block, the output process begins with a dataitem pointed to at the start of a group and continues until a data itemis reached that no longer points to the current group being processed.

As DMG sub-system 104 processes each section block, additional overlapblocks, such as overlap block 276, are created to keep track of howgroups overlap with each other. In embodiments of the invention, eachgroup block may have a pointer to one or more overlap blocks in anoverlap list. If the pointer is 0, then no subsequent group block in agroup list overlaps with the current group block being processed. Ifthere is a pointer to an overlap list for a particular group block, theneach entry in that overlap list represents a group block that overlapswith an original group block.

For example, if group block A is overlapped by group blocks B and C,then group block A will have an overlap list with pointers to groupblocks B and C. In embodiments of the invention, overlaps are recordedin sequential order between groups blocks included in a group list.Thus, although an overlap between group block A and group block B couldalso be read as an overlap between group block B and group block A, onlythe overlap between group block A and group block B is recorded sincethe overlap is recorded in sequential order (i.e., the recording startswith group blocks at the beginning of a section block). Recording anoverlap out of sequential order will result in an improper processing ofthe section block by DMG sub-system 104.

The following are examples of pointers for a section block, group block,data item block, and overlap block:

SECTION BLOCK:

NEXT_SECTION Points to the next section block in the section list1st_DATA_ITEM Points to the first data item within to the section block1st_GROUP Points to the first group block within the section blockCURR_GROUP Points to the current group block being processed

GROUP BLOCK:

NEXT_GROUP Points to the next group block in the group list START_DATAPoints to the first data item within a group block END_DATA Points tothe last data item within the group block OVERLAP Points to the start ofan overlap list

DATA ITEM BLOCK:

NEXT_ITEM Points to the next data item block in the data item listSECTION_BLOCK Points to the section block corresponding to the data itemblock GROUP_BLOCK Points to the group block corresponding to the dataitem block

OVERLAP BLOCK:

NEXT_OVERLAP Points to the next overlap block in the overlap listOWNING_GROUP Points to the group block which is being overlappedOVERLAPPER Points to the group block that causes the overlap

In embodiments of the invention, a group block can have a pointer to thestart and end data items in the group, but each data item can have apointer to the group block to which it belongs. In other words, it maynot be possible to directly determine all of the data items that belongto a particular group. This stems from the fact that if a group blockpointed to all of the data items within the group, a new entry to a listwould have to be created each time a new data item block is created inorder for the group block to point to each new data item. This wouldresult in the need for increased storage and processing time, as well asan increased complexity in managing all of the data structures.

For example, a current section block includes group block 1 (GB1) andgroup block 2 (GB2). GB1 includes data item blocks A, B, C, and D andGB2 includes data item block E. In this example, the data may bearranged as follows:

GB1_START_ITEM = A GB1_END_ITEM = D GB2_START_ITEM = E GB2_END_ITEM = EA_GROUP_BLOCK = GB1 A_NEXT_ITEM = B B_GROUP_BLOCK = GB1 B_NEXT_ITEM = CC_GROUP_BLOCK = GB1 C_NEXT_ITEM = D D_GROUP_BLOCK = GB1 D_NEXT_ITEM = EE_GROUP_BLOCK = GB2 E_NEXT_ITEM = 0 There is no subsequent data item inthe list

According to this arrangement, in order to find all of the data itemsthat belong to the group G1, DMG sub-system 104 reads through the dataitems in sequential order to find those data items that have a groupblock of G1. However, the actual data item list and group lists remainthe same.

In embodiments of the invention, DMG sub-system 104 performs thefollowing operations for each group included in a section block:

(1) If a group overlaps the following group:

-   -   (i) output an <xsd:choice>tag;    -   (ii) start a new recursive instance of DMG sub-system 104 at the        current point of its processing;    -   (iii) output the contents of the group under scrutiny; and    -   (iv) set the group as the current parent group

(2) If a group does not overlap with the following group:

-   -   (i) output the contents of the group under scrutiny

(3) If DMG sub-system 104 is in a recursive state and the state needs tobe terminated (e.g., the last group in the overlap list has beenreached):

-   -   (i) a return is made to the higher-level instances of DMG        sub-system 104

(4) For each group whose contents are output, each item is output in theorder that it was added to each group

When outputting the contents of a group, processing begins with the dataitem pointed to by the start of the group block and continues outputtingitems in the list until it reaches an item that no longer points to thecurrent group that is being processed.

A series of operational steps will now be described below for a methodof identifying data items and producing output data modelling languagein accordance with at least one embodiment of the invention. Referringnow to various embodiments of the invention in more detail, FIG. 3 is aflow chart diagram, generally designated 300, depicting operationalsteps for processing assembler code by assembler sub-system 102 inaccordance with at least one embodiment of the invention. It should beappreciated that assembler sub-system 102 may perform steps S302, S304,S306, and S308 substantially simultaneously, in sequential order, or aportion of the steps substantially simultaneously. The assembler codeincludes a plurality of sections and each section includes a pluralityof data items and/ or machine instructions. The following steps aredirected towards processing each of the plurality of sections.

At step S302, responsive to processing a new section of assembler code,assembler sub-system 102 creates an assembler anchor block and a firstgroup block. An assembler anchor block represents a section of assemblercode. Each assembler anchor block created is stored in a list. Whenassembler sub-system 102 creates an assembler anchor block correspondingto a section, it also creates a group block for the implicit value ofthe current location counter at the start of each section. The assembleranchor block corresponding to the current section being processed ispointed to by part of assembler sub-system 102 so that as sections arepaused and resumed, the assembler anchor block representing a sectionthat is currently being processed can be referenced.

At step S304, responsive to encountering a statement (e.g., an IBM®HLASM assembler language ORG (origin) instruction) that causes thecurrent location counter to change, assembler sub-system 102 creates anew group block. The group blocks are used to map groups of data itemsprocessed by assembler sub-system 102. The current group block in use ispointed to by the current assembler anchor block in use so that thestate of groups can be paused and resumed as sections are paused andresumed.

At step S306, responsive to encountering a data item, assemblersub-system 102 collects information about the data item into a data itemblock. A data item may be encountered via a language instruction of anassembler program. One example of an assembler language instruction is aDC or DS language instruction in the IBM® HLASM program. Informationabout the data item may include, but is not limited to the data item'sname, data type, length, offset within the current section, andduplication factor. All of the information about a data item block isstored as a linked list. The linked list is sorted by offset from thestart of the current section (to which all data items belong) and alsoby size if two or more items have the same offset within a programsection. The current group block that is in use is pointed to by thedata item block, which signifies that the data item belongs to thatgroup. Similarly, the starting and ending data items, as well as thestarting and ending offsets delimiting the group's state are alsoupdated as new data items are added to a group.

At step S308, assembler sub-system 102 stores each data item block. Inembodiments of the invention, each data item block is stored: (i) in theorder of their offsets; and (ii) in the order in which they are added toa section during the processing of the assembler code. Similarly, whenoutputting data items from a group, the same order is used. It isimportant that each data item is stored in this manner since there is anexception to the uniqueness of the offsets of data items in a group if agroup has a number of items of size 0. For example, data item D1 is atoffset 32 and has a size of 0. Data item D2 follows data item D1 (i.e.,D1 and D2 are in the same group) and has a size of 8. In this example,the location counter has not been manipulated and thus no new group hasbeen created. Although D1 starts at offset 32, data D2 will also startat offset 32 because D1 has a size of 0. Accordingly, an overlap willoccur between D1 and D2 at offset 32 for the same group.

FIG. 4 is a flow chart diagram, generally designated 400, depictingoperational steps for DMG sub-system 104 in accordance with at least oneembodiment of the invention. The following operational steps aredirected towards refining groups of blocks corresponding to a sectionblock. The refining process is repeated for each group of blockscorresponding to a section block. For any non-empty section blocks forthe program, a standard data model header may be output by DMGsub-system 104.

At step S402, DMG sub-system 104 removes any groups from a section thatdo not include at least one data item.

At step S404, DMG sub-system 104 consolidates any adjacent groups thatdo not overlap with each other.

At step S406, DMG sub-system 104 sorts groups from the beginning of thesection based on offset order. If two or more groups have the sameoffset, then the largest group is sorted earlier in the group list.

At step S408, DMG sub-system 104 generates a pseudo-sequential order ofthe data items associated with each group. The pseudo-sequential orderis the order of data items as sorted by their offset from the start ofthe section for each group. If two or more items have the same offset ina group, then the largest item is stored earlier in the group list. Thepseudo-sequential order is import since it is used to delimit the scope(i.e., domain/size) of each group.

At step S410, for each group in the group list, DMG sub-system 104determines a degree of overlap with an adjacent group. For example, agroup list includes Group A, Group B, Group C and Group D in sequentialorder. Here, Group A and Group B are analyzed for overlap, Group B andGroup C are analyzed for overlap, and Group C and Group D are analyzedfor overlap. The following is a list of possible ways in which a degreeof overlap can be measured between two adjacent groups:

-   -   (1) No Overlap—No overlap is present between two groups    -   (2) Identical Overlap—Both groups are the same size and start at        the same offset    -   (3) Partial Overlap—The second group begins at an offset within        the scope of the first group, but ends outside the scope of the        first group    -   (4) Engulfing Overlap:        -   (i) At the Start—The second group begins at an offset which            is equal to the start of the first group and ends at an            offset within the scope of the first group        -   (ii) Completely—The second group begins at an offset within            the scope of the first group and ends within the scope of            the first group        -   (iii) At the End—The second group begins at an offset within            the scope of the first group and ends at the same offset as            the first group    -   (5) Non-Identical Overlap—Includes both a partial overlap and an        engulfing overlap

At step S412, for each pair of adjacent groups that have a non-identicaloverlap, DMG sub-system 104 performs a group modification. Inembodiments of the invention, a group modification may include splittinga group or padding a group. If splitting is performed, the data items inthe first group in the pair are split into two new groups such that thefirst new group contains all the data items in the original first groupuntil the “split point” and the second new group contains the data itemsof the first group after the “split point.” The second new group isadded to the end of the group list for the current section. If paddingis performed, the second group in the pair is padded to match the sizeof the first group. The decision on whether a first group is split or asecond group is padded is dependent on the number of data items and theoffset position of the data items belonging to a pair of groups. Thedecision whether to split or pad will be further explained in FIGS.6B-6D.

At step S414, responsive to performing a group modification, DMGsub-system 104 repopulates the group list. Repopulating the group listremoves any groups which no longer have any data items. At step S416,responsive to repopulating the group list, DMG sub-system sorts therepopulated group list to take into account any new groups (and theirassociated data items) created from the splitting. For example, a grouplist includes group blocks A, B, and C. If splitting is performedbetween group blocks B and C, then group block B is split into twogroups and a new group (group block D) is added after group block C.Steps S412-S416 may be repeated for each pair of adjacent groups in asection block that have a non-identical overlap. If a pair of adjacentgroups have an identical overlap or no overlap, steps S412-S416 areskipped. This process continues for each sequential group in a sectionuntil the last group in a section is reached.

Once the refinement process is complete, at step S418, a subroutine iscalled to create an overlap list for each group. An overlap list maygenerally be understood as a list of groups that overlap another group.At this stage, any overlap between two groups should be identical. Itshould be appreciated that once an overlap list is created, DMGsub-system 104 is able to identify exactly which groups a particulargroup overlaps with, and more specifically, which data items overlapwith a particular group. In some embodiments, DMG sub-system 104 bases adata modeling language for a section at least in part on a set ofoverlap lists. In further embodiments, DMG sub-system 104 bases a datamodeling language for a section at least in part on a degree of overlapbetween a plurality of groups. In alternative embodiments, DMGsub-system 104 generates a data modeling language that defines a set ofhierarchical data model elements in an assembler code.

FIG. 5 is a flowchart diagram, generally designated 500, depictingoperational steps for DMG sub-system 104 in accordance with at least oneembodiment of the invention. The following operational steps aredirected towards processing and outputting the refined group list. Atstep S502, DMG sub-system 104 starts a new recursive instance for agroup that has an overlap list. Starting a new recursive instanceindicates that DMG sub-system 104 is currently processing an<xsd:choice>group. The group that causes the new recursive instance isset as the current “parent” for the new instance.

At step S504, responsive to starting the new recursive instance, DMGsub-system 104 outputs an <xsd:choice> tag and any associatedinformation.

At step S506, DMG sub-system 104 outputs the contents of the “parent”group. The output of the contents of the “parent” group is initiated byoutputting an <xsd:sequence>tag. An <xsd:sequence> tag is output heresince all data items within the “parent” group are sequential. Inembodiments of the invention, data items are output according to their“real order.” The “real order” may generally be understood as the orderin which the data items were added to the list of data items belongingto each successive group in a section.

At step S508, once the data item has been output which matches thecurrent group's end item, the next group is checked to determine whetheror not a new recursive instance needs to be started for anysubgroupings. The DMG sub-system 104 may output </xsd:sequence>asnecessary to denote the end of the sequence of data items output.

At step S510, once the end of the current group is reached, the currentinstance returns to its “parent.” Since there are no more groups toprocess at this recursive level, DMG sub-system 104 returns to its“caller” (i.e., the previous recursive instance) and outputs</xsd:choice>.

At step S512, responsive to outputting the current “parent,” DMGsub-system 104 determines whether a new subsequence should be started. Asubsequence may generally be understood as a set of groups which aresequential despite DMG sub-system 104 currently being in a recursivestate caused by a “choice” group. Determining whether a new subsequenceshould be started is dependent on how the next two groups overlap witheach other. If the next two groups do not overlap with each other, thenthe current recursive instance is terminated and a new subsequence isstarted. Here, a new subsequence is started by staring a new recursiveinstance and marking the instance as “NOT” in a choice.

In embodiments of the invention, for each recursive instance that isterminated, it must pass back to its caller the last group in the listwhich it processed. This is done so that processing at the caller'slevel can continue at the next unprocessed group. In embodiments of theinvention, whenever a recursive instance is terminated, DMG sub-system104 outputs either an </xsd:choice> tag (if the instance was marked as“choice”) or an </xsd:sequence> tag (if the instance was marked as“sequence”).

FIGS. 6A-6D are schematic diagrams, generally designated 600,illustrating the following worked example of the group refinementprocess. The following data will be used through the worked example:

MY_DATA_1 DC F′1′ ORG MY_DATA_1 MY_DATA_2 DC HL3′2′ MY_DATA_3 DC X′3′ORG MY_DATA_2 MY_DATA_4 DC X′4′ MY_DATA_5 DC X′5′ ORG MY_DATA_4MY_DATA_6 DC X′6′ MY_DATA_7 DC X′7′

At the start of the refinement process, assembler sub-system 102 createsa section block as depicted in FIG. 6A. The section block includes groupblocks (A) 610, (B) 620, (C) 630, and (D) 640. Group block A includesdata item MY_DATA_1 601. MY_DATA_1 starts at offset 0 and ends at offset3. Group block B includes data items MY_DATA_2 602 and MY_DATA_3 603.MY_DATA_2 starts at offset 0 and ends at offset 2. MY_DATA_3 starts atoffset 3 and ends at offset 4. Group block C includes data itemsMY_DATA_4 604 and MY_DATA_5 605. MY_DATA_4 starts at offset 0 and endsat offset 1. MY_DATA_5 starts at offset 1 and ends at offset 2. Groupblock D includes data items MY_DATA_6 606 and MY_DATA_7 607. MY_DATA_6starts at offset 0 and ends at offset 1. MY_DATA_7 starts at offset 1and ends at offset 2. As depicted in FIG. 6A, all of the group blocksoverlap each other, but not all of the data items within the groupblocks overlap with each other. For example, Group block (B) 620 andGroup block (C) 630 overlap each other, but MY_DATA_5 605 does notoverlap both MY_DATA_2 602 and MY_DATA_3 603. MY_DATA_5 605 onlyoverlaps MY_DATA_2 602.

Continuing with FIG. 6A, the group refinement process beings byexamining group block (A) 610 and group block (B) 620. It should beunderstood that the refinement process begins with the first group andmoves sequentially through each adjacent group in the section block. Asdepicted in FIG. 6A, group block (A) 610 and group block (B) 620 overlapeach other identically since their size and position of their overlap isidentical (i.e., both group A and group B start at offset 0 and end atoffset 3). Since they have an identical overlap, group A and group B canbe output as a single choice and no adjustment to these two groups ismade.

The refinement process continues with the group block (B) and groupblock (C) 630. As depicted in FIG. 6A, group block (B) 620 and groupblock (C) 630 do not have an identical overlap since there is no dataitem in group block (C) that overlaps with data item MY_DATA_3 603.Accordingly, a subroutine is called to determine if a data item in groupblock (B) 620 can be split. Since there are multiple data items in groupblock B 620, MY_DATA_3 603 is split from MY_DATA_2 602. Here, thesplitting of group block (B) 620 will cause MY_DATA_3 603 to be removedfrom group block (B) 620 and placed into a newly created group block (E)650 at the end of the section block.

After the splitting of group bock (B) is complete, FIG. 6B depicts thesection block after the groups have been re-populated and re-sorted. Asdepicted in FIG. 6B, MY_DATA_3 603 is now positioned in group block (E)650 at offset 3. The refinement process continues with the next group tobe processed. Since group block (B) 620 has changed from the splitting(the removal of MY_DATA_3 603), the refinement process starts again atgroup block (B) 620.

As depicted in FIG. 6B, group block (B) 620 and group block (C) 630 donot have an identical overlap, but instead have an engulfing overlap “atthe start.” Accordingly, a subroutine is called to determine if a dataitem in group block (B) 620 can be split. Since there is only a singledata item (MY_DATA_2 602) in group block (B), a split cannot occur.Instead, group block (C) 630 is padded at 608 (FIG. 6C) so that its sizematches that of group block (B) 620. After the padding of group block(C) 630, group block (B) 620 and group block (C) 630 have an identicaloverlap. Accordingly, no further processing on group block (B) 620 isrequired.

FIG. 6C depicts the section block after the padding of group block (C)630. The refinement process continues with the next group to beprocessed. Since group block (C) 630 changed from the added padding, therefinement process starts again at group block (C) 630. As depicted inFIG. 6C, group block (C) 630 and group block (D) 640 do not have anidentical overlap, but instead have an engulfing overlap “at the start.”Accordingly, a subroutine is called to determine if a data item in groupblock (C) 630 can be split. Since padding was added to group block (C)630, any data items in the group cannot be split. Instead, group block(D) 640 is padded at 609 (FIG. 6D) so that its size matches that ofgroup block (C) 630. After padding group block (D) 640, group block (C)630 and group block (D) 640 have an identical overlap. Accordingly, nofurther processing on group C is required.

FIG. 6D depicts the section block after the padding of group block (D)640. The refinement process continues with the next group to beprocessed. Since group block (D) 640 changed from the added padding, therefinement process starts again at group block (D) 640. As depicted inFIG. 6D, group block (D) 640 and group block (E) 650 have no overlap.Since there is no overlap between the groups, no adjustment is made togroup block (D) 640. The refinement process continues with the nextgroup to be processed (group block (E) 650). Since group block (E) 650is at the end of the section block, the refinement process is complete.

Continuing with the current worked example, once the refinement processis complete, DMG sub-system 104 creates the following overlap list:

(A) overlaps with (B), (C), (D), and (E)

(B) overlaps with (C) and (D)

(C) overlaps with (D)

(D) has no overlaps

(E) has no overlaps

After creating the above overlap list, DMG sub-system 104 beginsoutputting the groups. Since group block (A) 610 has a choice, a newrecursive instance (RECUR_1) is started, an <xsd:choice> is output,group block (A) 610 is output, and designated as the group parent. TheDFDL output is as follows:

<xsd:choice ...> <xsd:element name=″MY_DATA_1″... />

At the end of processing group block (A) 610, the next group (groupblock (B) 620) is checked to determine whether or not a new subsequenceshould be started. Since group block (A) 610 does not overlapidentically with group block (B) 620, it is not possible to start a newsubsequence.

Group block (B) 620 is now examined. Since group block (B) 620 has anoverlap, a new recursive (RECUR_2) instance is started, an <xsd:choice>is output, group block (B) 620 is output, and designated as the groupparent. The DFDL output is as follows:

<xsd:choice ...>  <xsd:element name=″MY_DATA_1″ ... />  <xsd:choice>  <xsd:sequence>    <xsd:element name=″MY_DATA_2″ ... />

At the end of processing group block (B) 620, the next group (groupblock (C) 630) is checked to determine whether or not a new subsequenceshould be started. Since group blocks (B) 620 and (C) 630 have anidentical overlap and group blocks (B) 620 and (D) 640 have an identicaloverlap, they are determined to be peers and therefore a new subsequenceis initiated. Here, a new recursive instance (RECUR_3) is started thatis in a “sequence” rather than a “choice.” Group block (B) 620 is thenset as the parent for the new recursive instance and all groups areoutput in sequence until the end of group block B′s overlap list (i.e.,group block (C) 630 and group block (D) 640 are output). The DFDL outputhere is as follows:

<xsd:choice ...>  <xsd:element name=″MY_DATA_1″ ... />  <xsd:choice>  <xsd:sequence>    <xsd:element name=″MY_DATA_2″ ... />  </xsd:sequence>   <xsd:sequence>    <xsd:element name=″MY_DATA_4″ .../>    <xsd:element name=″MY_DATA_5″ ... />   </xsd:sequence>  <xsd:sequence>    <xsd:element name=″MY_DATA_6″ ... />    <xsd:elementname=″MY_DATA_7″ ... />   </xsd:sequence>

Once the end of the overlap list of the current parent, group block (B)620 is reached, the current recursive state (RECUR_3) terminates andrelays that the last group to have been processed was group (D). Theparent in recursive state RECUR_2 is group block (B) 620. Since it is atthe end of group (B)'s overlap list and has already been output, therecursive state RECUR_2 is terminated, an </xsd:choice> tag is output(since RECUR_2 is in a choice state) and group (D) is passed back to thecaller. At this stage, the DFDL output looks as follows:

<xsd:choice ...>  <xsd:element name=″MY_DATA_1″ ... />  <xsd:choice>  <xsd:sequence>    <xsd:element name=″MY_DATA_2″ ... />  </xsd:sequence>   <xsd:sequence>    <xsd:element name=″MY_DATA_4″ .../>    <xsd:element name=″MY_DATA_5″ ... />   </xsd:sequence>  <xsd:sequence>    <xsd:element name=″MY_DATA_6″ ... />    <xsd:elementname=″MY_DATA_7″ ... />   </xsd:sequence>  </xsd:choice>

At this point, the current recursive state of DMG sub-system 104 isRECUR_1 and the parent is group block (A) 610. Since the last group thatwas processed was group block (D) 640, the next group to be processed isgroup block (E) 650. Since group block (E) 650 has no overlaps, thegroup block (E) 650 is output. The DFDL output looks as follows:

<xsd:choice ...>  <xsd:element name=″MY_DATA_1″ ... />  <xsd:choice>  <xsd:sequence>    <xsd:element name=″MY_DATA_2″ ... />  </xsd:sequence>   <xsd:sequence>    <xsd:element name=″MY_DATA_4″ .../>    <xsd:element name=″MY_DATA_5″ ... />   </xsd:sequence>  <xsd:sequence>    <xsd:element name=″MY_DATA_6″ ... />    <xsd:elementname=″MY_DATA_7″ ... />   </xsd:sequence>  </xsd:choice>  <xsd:elementname=″MY_DATA_3″ ... />

Since the end of the list has been reached, the recursive state RECUR_1is terminated and group (E) is passed back to the original caller. AsRECUR_1 terminates, an </xsd:choice> tag is output (since RECUR_1 is ina choice state). At the end of this processing, the DFDL looks asfollows:

<xsd:choice ...>  <xsd:element name=″MY_DATA_1″ ... />  <xsd:choice>  <xsd:sequence>    <xsd:element name=″MY_DATA_2″ ... />  </xsd:sequence>   <xsd:sequence>    <xsd:element name=″MY_DATA_4″ .../>    <xsd:element name=″MY_DATA_5″ ... />   </xsd:sequence>  <xsd:sequence>    <xsd:element name=″MY_DATA_6″ ... />    <xsd:elementname=″MY_DATA_7″ ... />   </xsd:sequence>  </xsd:choice>  <xsd:elementname=″MY_DATA_3″ ... /> </xsd:choice>

Once the end of all groups for the current section has been reached, theDMG sub-system 104 exits its recursive states until it reaches theoriginal non-recursive level of itself. From this point, it can startprocessing the next section block in the list of sections for thecurrent program. Once all section blocks have been output, a DFDL footersection is output. It should be appreciated that the previous workedexample demonstrates a method for DFDL generation within an assemblerlanguage that allows for the discovery of high-level language datastructures.

What is claimed is: 1-7. (canceled)
 8. A computer program product for transforming implicit data structures expressed by assembler code into high-level language structures, the computer program product comprising one or more computer readable storage media and program instructions stored on the one or more computer readable storage media, the program instructions comprising instructions to: analyze a section of assembler code to identify a plurality of data items, wherein the section of assembler code has a beginning and an end; store the plurality of data items in a plurality of groups, wherein: the plurality of groups corresponds to the section of assembler code; and the plurality of data items is stored based, at least in part, on: their offset from a start of a group in the section; and an order in which the data items are added to the section; modify one or more groups in the plurality of groups based, at least in part, on a pair of adjacent groups having a non-identical overlap, wherein the instructions to modify the one or more groups in the plurality of groups further include instructions to perform at least one of splitting or padding the pair of adjacent groups based, at least in part, on: (i) a number of data items included in the pair of adjacent groups, and (ii) an offset position of each data item in the pair of adjacent groups; create an overlap list for each group, wherein the overlap list identifies those other groups in the plurality of groups that overlap with the group; and generate data modeling language for the section based, at least in part, on each overlap list.
 9. The computer program product of claim 8, wherein the instructions to perform at least one of splitting or padding the pair of adjacent groups include instructions to: split two data items stored in a first group of the pair of adjacent groups into two groups, such that: a first sub-group contains data items of the first group up to a split point, and a second sub-group contains data items of the first group after the split point.
 10. The computer program product of claim 8, wherein the instructions to perform at least one of splitting or padding the pair of adjacent groups include instructions to: pad a second group in the pair of adjacent groups to match a size of a first group in the pair of adjacent groups.
 11. (canceled)
 12. The computer program product of claim 8, wherein two groups are determined to overlap if a data item in each group shares a common offset position in the section.
 13. The computer program product of claim 8, wherein the instructions to generate the data modeling language for the section is further based, at least in part, on instructions to determine a degree of overlap between two groups.
 14. The computer program product of claim 8, wherein the data modeling language defines hierarchical data model elements in the assembler code.
 15. A computer system for transforming implicit data structures expressed by assembler code into high-level language structures, the computer system comprising: one or more computer processors; one or more computer readable storage media; and computer program instructions; the computer program instructions being stored on the one or more computer readable storage media for execution by the one or more computer processors; and the computer program instructions comprising instructions to: analyze a section of assembler code to identify a plurality of data items, wherein the section of assembler code has a beginning and an end; store the plurality of data items in a plurality of groups, wherein: the plurality of groups corresponds to the section of assembler code; and the plurality of data items is stored based, at least in part, on: their offset from a start of a group in the section; and an order in which the data items are added to the section; modify one or more groups in the plurality of groups based, at least in part, on a pair of adjacent groups having a non-identical overlap, wherein the instructions to modify the one or more groups in the plurality of groups further include instructions to perform at least one of splitting or padding the pair of adjacent groups based, at least in part, on: (i) a number of data items included in the pair of adjacent groups, and (ii) an offset position of each data item in the pair of adjacent groups; create an overlap list for each group, wherein the overlap list identifies those other groups in the plurality of groups that overlap with the group; and generate data modeling language for the section based, at least in part, on each overlap list.
 16. The computer system of claim 15, wherein the instructions to perform at least one of splitting or padding the pair of adjacent groups include instructions to: split two data items stored in a first group of the pair of adjacent groups into two groups, such that: a first sub-group contains data items of the first group up to a split point, and a second sub-group contains data items of the first group after the split point.
 17. The computer system of claim 15, wherein the instructions to perform at least one of splitting or padding the pair of adjacent groups include instructions to: pad a second group in the pair of adjacent groups to match a size of a first group in the pair of adjacent groups.
 18. (canceled)
 19. The computer system of claim 15, wherein two groups are determined to overlap if a data item in each group shares a common offset position in the section.
 20. The computer system of claim 15, wherein the instructions to generate the data modeling language for the section are further based, at least in part, on instructions to determine a degree of overlap between two groups. 